package com.jbm.jbmsupplier.adapter;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CheckBox;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.TextView;

import com.jbm.jbmsupplier.R;
import com.jbm.onehome.iface.LoginEntity;

import java.util.ArrayList;

/**
 * Created by 家帮忙 on 2017/9/25.
 */

public class PreManageAdapter extends RecyclerView.Adapter<PreManageAdapter.MyViewHoder> {
   Context context;
      ArrayList<LoginEntity> listEnti;

    public PreManageAdapter(Context context, ArrayList<LoginEntity> listEnti1) {
        this.context = context;
        this.listEnti = listEnti1;
    }
    @Override
    public PreManageAdapter.MyViewHoder onCreateViewHolder(ViewGroup parent, int viewType) {
        return new MyViewHoder(View.inflate(context,R.layout.searchmanage_listitem,null ));
    }

    @Override
    public void onBindViewHolder(PreManageAdapter.MyViewHoder holder,final int position) {
        holder.text_perm_name.setText(listEnti.get(position).getNickname());
    }
    @Override
    public int getItemCount() {
        return listEnti.size();
    }
    public  class MyViewHoder extends RecyclerView.ViewHolder{
        TextView text_perm_name ;
        CheckBox image_prem_fuguanli;
        CheckBox  image_prem_shigongdui ;
        CheckBox image_prem_ludan;
        CheckBox image_prem_kefu ;
        ImageButton image_prem_tichu;
        ImageView text_perm_image ;
        public MyViewHoder(View itemView) {
            super(itemView);
            text_perm_name= (TextView) itemView.findViewById(R.id.text_perm_name);
            image_prem_fuguanli= (CheckBox) itemView.findViewById(R.id.image_prem_fuguanli);
            image_prem_shigongdui= (CheckBox) itemView.findViewById(R.id.image_prem_shigongdui);
            image_prem_ludan= (CheckBox) itemView.findViewById(R.id.image_prem_ludan);
            image_prem_kefu= (CheckBox) itemView.findViewById(R.id.image_prem_kefu);
            image_prem_tichu= (ImageButton) itemView.findViewById(R.id.image_prem_tichu);
            text_perm_image= (ImageView) itemView.findViewById(R.id.text_perm_image);
//            ButterKnife.inject(context,itemView);




        }
    }



}
